package com.nkym.controller;/*
 * @ClassName TestController
 * @Desc TODO
 * @Author 19637
 * @Date 2023/4/20 15:45
 * @Version 1.0
 */

import com.nkym.common.BaseResponse;
import com.nkym.entity.User;
import com.nkym.utils.ResultUtil;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/api")
public class TestController {


    @PostMapping("/user")
    public BaseResponse<Object> getUser(@RequestBody User user, HttpServletRequest request) {
        System.out.println(user);
        return ResultUtil.success(user, "成功");
    }

    @PostMapping("/name")
    public BaseResponse<Object> getName(@RequestBody String name, HttpServletRequest request) {
        return ResultUtil.success(name, "成功");
    }

    @GetMapping("/user")
    public BaseResponse<Object> user(@RequestBody User user) {
        System.out.println(user);
        return ResultUtil.success(user);
    }
}
